home *** CD-ROM | disk | FTP | other *** search
Text File | 1996-11-03 | 3.2 KB | 133 lines | [TEXT/CWIE] |
- /*
- GEQDBe.h
-
- Graphic Elements QD compatibility module for BeOS
-
- Copyright 1996 by Al Evans. All rights reserved.
-
-
- */
-
- // Analogs of Mac QuickDraw entities and calls for BeOS version
-
- // Mac-compatible Point and Rect
-
- typedef struct {
- long h;
- long v;
- } Point;
-
- typedef enum {v, h} VHSelect;
-
- typedef struct {
- long top;
- long left;
- long bottom;
- long right;
- } Rect;
-
- void BRectToGERect(BRect *br, Rect *r);
- void GERectToBRect(Rect *r, BRect *br);
-
- typedef BRegion *RgnHandle;
-
- #define srcCopy B_OP_COPY
- #define srcOr B_OP_OVER
- #define transparent B_OP_OVER
-
- // Mac-compatible text styles
- // Not presently implemented for the BeBox
-
- #define normal 0
- #define bold 1
- #define italic 2
- #define underline 4
- #define outline 8
- #define shadow 16
- #define condense 32
- #define extend 64
-
- typedef struct font_info FontInfo;
-
- typedef BView *BViewPtr;
- typedef BBitmap *BitMap;
-
- typedef struct {
- Rect portRect;
- BViewPtr portWindow; // nil except for geWorld->gEWPort
- BitMap portBits;
- } GWorld, *GWorldPtr;
-
- // As used in Graphic Elements, these are all equivalent
- typedef GWorldPtr GrafPtr;
- typedef GWorldPtr CGrafPtr;
-
- // Ugly, but usage is the same
- typedef BitMap PixMapHandle;
-
- // Mac-compatible RGBColor
- typedef struct RGBColor {
- unsigned short red;
- unsigned short green;
- unsigned short blue;
- } RGBColor;
-
- typedef ulong OSType;
- typedef long GDHandle; // placeholder, nothing comparable on BeBox
- typedef color_map *CTabHandle; // not useful as of 1.1d6
- typedef ulong Fixed;
-
- typedef long OSErr;
-
- // Flag to create GWorld which accepts views
- #define gWorldAcceptsViews 1
-
- OSErr NewGWorld( GWorldPtr *offscreenGWorld,
- short offscrnDepth,
- Rect *boundsRect,
- CTabHandle worldColors, GDHandle aGDevice, unsigned long flags);
-
- void DisposeGWorld(GWorldPtr world);
- inline void DisposCTable(CTabHandle cTable) {}; // not useful as of 1.1d6
-
- void GetPort (GrafPtr * savePort);
- void SetPort (GrafPtr newPort);
- void SetOrigin(short h, short v);
- void InvalRect(Rect * invalRect); // causes repaint
-
- inline RgnHandle NewRgn() {return new BRegion();}
- inline void DisposeRgn(RgnHandle rgn) {delete rgn;}
- void RectRgn(RgnHandle region, Rect *newRect);
- inline void CopyRgn(RgnHandle source, RgnHandle dest) {dest = source;}
- inline void OffsetRgn(RgnHandle r, short dh, short dv) {r->OffsetBy(dh, dv);}
- void SectRgn(RgnHandle a, RgnHandle b, RgnHandle result);
- void DiffRgn(RgnHandle a, RgnHandle b, RgnHandle result);
-
- void UnionRgn(RgnHandle a, RgnHandle b, RgnHandle result);
-
- inline Boolean PtInRgn(Point pt, RgnHandle rgn) {return (rgn->Contains(BPoint(pt.h,pt.v)));}
- Boolean PtInRect(Point pt, Rect *rect);
-
- void GetGWorld(CGrafPtr *port, GDHandle *gdh);
- void SetGWorld(CGrafPtr port, GDHandle gdh);
- PixMapHandle GetGWorldPixMap(GWorldPtr world);
-
- // Used only in TextGE
- void ClipRect(Rect *rect);
-
- // Not needed for BeOS version
- #define GlobalToLocal(Point)
- #define LockPixels(PixMapHandle)
- #define NoPurgePixels(PixMapHandle)
-
- void EraseRect(Rect * r);
-
- GE_CALLBACK(void,CopyBits)(const BitMap *srcBits, const BitMap *dstBits,
- const Rect *srcRect, const Rect *dstRect, short mode, RgnHandle maskRgn);
-
- #define FastCopyBits QuickCopyBits
-
-
-
-
-